package homework2;

import java.util.Scanner;

public class PrimeNumber {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个数：");
        int num=sc.nextInt();
        int j=0;
        //int a=(num/num=1&&num!=1);
        for (int i=1;i<=num;i++){
            if (num%i==0){
                j=j+1;
            }
            }
        if(j==2) {
            System.out.println("此数为质数");

        }else{
            System.out.println("此数不为质数");

        }
    }
}
